using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_PHGuar2AMTMap : EntityTypeConfiguration<SO_PHGuar2AMT>
    {
        public SO_PHGuar2AMTMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Description, t.SUMFIELDS, t.DIMFIELDS });

            // Properties
            this.Property(t => t.Physician_id)
                .HasMaxLength(6);

            this.Property(t => t.Description)
                .IsRequired()
                .HasMaxLength(250);

            this.Property(t => t.Guarantor_2)
                .HasMaxLength(50);

            this.Property(t => t.SUMFIELDS)
                .IsRequired()
                .HasMaxLength(51);

            this.Property(t => t.DIMFIELDS)
                .IsRequired()
                .HasMaxLength(21);

            // Table & Column Mappings
            this.ToTable("SO_PHGuar2AMT");
            this.Property(t => t.Physician_id).HasColumnName("Physician_id");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.date).HasColumnName("date");
            this.Property(t => t.Guarantor_2).HasColumnName("Guarantor_2");
            this.Property(t => t.PHYSICIAN_AMOUNT_Base_2).HasColumnName("PHYSICIAN_AMOUNT_Base_2");
            this.Property(t => t.GUARANTOR_2_AMOUNT_Base_2).HasColumnName("GUARANTOR_2_AMOUNT_Base_2");
            this.Property(t => t.SUMFIELDS).HasColumnName("SUMFIELDS");
            this.Property(t => t.DIMFIELDS).HasColumnName("DIMFIELDS");
        }
    }
}
